import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int len = str.length();
        char[] ch = new char[len];
        int i = 0;
        while(i < str.length()) {
            if( str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') {
                ch[i] = (char)((ch[i] - 'A') + 'a');
                i++;
            }else {
                ch[i] = str.charAt(i);
                i++;
            }
        }

        i = 0;
        len = len -1;
        while(i < len) {
            char tmp = ch[i];
            ch[i] = ch[len];
            ch[len] = tmp;
            i++;
            len--;
        }

        for(int j = 0; j < ch.length; j++) {
            System.out.print(ch[j]);
        }
    }
}
